import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/ruoyi";

// 查询生成表数据
export function listTable(query) {
  return request({
    url: '/jihuo/sysTrafficRecord/list',
    method: 'get',
    params: query
  })
}

export function getCurrentUserTrafficRecord(query) {
  return request({
    url: '/jihuo/sysTrafficRecord/getCurrentUserTrafficRecord',
    method: 'get',
    params: query
  })
}

// 新增加密串
export function addSysTrafficRecord(data) {
  return request({
    url: '/jihuo/sysTrafficRecord/insertSysTrafficRecord',
    method: 'post',
    data: data
  })
}

// 充值
export function rechargeTraffic(data) {
  return request({
    url: '/jihuo/sysTrafficRecord/rechargeTraffic',
    method: 'put',
    data: data
  })
}

// 修改加密串
export function updateSysTrafficRecord(data) {
  return request({
    url: '/jihuo/sysTrafficRecord/updateJhSysTrafficRecord',
    method: 'put',
    data: data
  })
}

// 查询加密串详细
export function getSysTrafficRecord(id) {
  return request({
    url: '/jihuo/sysTrafficRecord/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 禁用加密串
export function disableSysTrafficRecord(id) {
  return request({
    url: '/jihuo/sysTrafficRecord/disableRecord/' + parseStrEmpty(id),
    method: 'put',
  })
}

// 启用加密串
export function enableSysTrafficRecord(id) {
  return request({
    url: '/jihuo/sysTrafficRecord/enableRecord/' + parseStrEmpty(id),
    method: 'put',
  })
}

// 删除加密串
export function deleteSysTrafficRecord(id) {
  return request({
    url: '/jihuo/sysTrafficRecord/deleteRecord/' + parseStrEmpty(id),
    method: 'delete'
  })
}
